﻿using Cognex.VisionPro;
using Cognex.VisionPro.ToolBlock;
using Cognex.VisionPro.PMAlign;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Windows;
using YJYpublicClass;
using System.ComponentModel;

namespace WindowsFormsApp2.JiayuModelset
{
    [Serializable]
    public class JayuYindaomodel
    {
        //模型类，模型类包括，插针定义，对应的流程VPP，参考基准点，
        //
        public string _款式名称 { get; set; } = "新款式";
        public int _款式序号 { get; set; } = 0;
        public int _上1显示图片索引 { get; set; } = 0;

        public int _上2显示图片索引 { get; set; } = 0;

        public int _下1显示图片索引 { get; set; } = 0;

        public int _下2显示图片索引 { get; set; } = 0;


        //视觉引导VPP
        public CogToolBlock mainvppblock = new CogToolBlock();
       
        [NonSerialized]
        public CogAcqFifoTool _BFifoAcq_tool = null;  //主取图模块
        //如果存在其他规格的取图，则进行如下处理
        //CCD2
        //第二次拍照复检流程，判定插针是否都插到位
        [NonSerialized]
        public CogToolBlock _上工位检测工具 = new CogToolBlock(); 


        [NonSerialized]
        public CogToolBlock _下工位检测工具 = new CogToolBlock();


        public ResultFunc init()
        {
            try
            {
                //对第一次拍照部分进行赋值
                //_BFifoAcq_tool = mainvppblock.Tools["CogAcq"] as CogAcqFifoTool;
                _上工位检测工具 = mainvppblock.Tools["Top_Detect"] as CogToolBlock;
                _下工位检测工具 = mainvppblock.Tools["Low_Detect"] as CogToolBlock;
                return new ResultFunc(Funstate.OK, "");
            }
            catch (Exception ex)
            {
                return new ResultFunc(Funstate.异常, ex.ToString());
            }

        }

    }


}
